<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="mobileOptimized" content="240" />
<meta name="format-detection" content="telephone=no" />
<title>dom操作和javascript对象操作性能对比</title>
</head>
<body>



<div id="dom"></div>
<script type="text/javascript">


var scriptOjb = {a:"b"};
var start = new Date();
for(var i=0;i<100000;i++){
	scriptOjb.a = "c"+i;
}
console.log("简单javascript对象写入时间"+(new Date()-start));
</script>
<script type="text/javascript">

var scriptOjb = document.getElementById("dom");
start = new Date();
for(var i=0;i<100000;i++){
	scriptOjb.a = "c"+i;
}
console.log("简单dom元素写入时间"+(new Date()-start));

</script>
<script type="text/javascript">

var scriptOjb = document.getElementById("dom");
start = new Date();
for(var i=0;i<100000;i++){
	scriptOjb.title = i;
}
console.log("简单dom元素写入特有属性时间"+(new Date()-start));

</script>
</body>
</html>